// Lang_05 [Streams].nova // The application class. class StreamsApp { // Application class's "main" function. public static void main( String[] args ) { // Ouput an input prompt. Stream.write( "Please enter a line of text >" ); // Input a line of text into a new String object. String str = Stream.readLine( ); // Output the string. Stream.write( "The line you entered was: " ); Stream.writeLine( str ); // Ouput an input prompt. Stream.write( "Please enter a character >" ); // Read the next character from the input stream. char c = Stream.readChar( ); // Output the Character. Stream.write( "The character you entered was: " ); Stream.writeLine( c ); // Test the Stream class static attributes (in, out). testStreamAttributes( ); } // Test the Stream class static attributes (in, out). public static void testStreamAttributes( ) { // Ouput an input prompt. Stream.out.write( "Please enter a line of text >" ); // Input a line of text into a new String object. String str = Stream.in.readLine( ); // Output the string. Stream.out.write( "The line you entered was: " ); Stream.out.writeLine( str ); // Ouput an input prompt. Stream.out.write( "Please enter a character >" ); // Read the next character from the input stream. char c = Stream.in.readChar( ); // Output the Character. Stream.out.write( "The character you entered was: " ); Stream.out.writeLine( c ); } }